﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ECCSystem.DataAccess
{ 
    class ClsReports:DBObject 
    {
        public ClsReports()
        { }

		#region "Old"
		public DataSet GetCSRReport(string strStartDate,string strEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            return this.RunProcedure("sp_Report_CRS", parameters, "CSRReport");
        }

        public DataSet GetExtrasReport(string strStartDate, string strEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            return this.RunProcedure("sp_Report_Extras", parameters, "ExtrasReport");
        }

        public DataSet GetJapansReport(string strStartDate, string strEndDate,string strOperator)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20),new SqlParameter("@Operator",SqlDbType.NVarChar,30)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            parameters[2].Value = strOperator;
            return this.RunProcedure("sp_Report_Japans", parameters, "JapansReport");
        }

        public DataSet GetCRSCategoryReport(string strDate, int intOperatorID)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@ECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@OperatorID",SqlDbType.Int)
            };
            parameters[0].Value = strDate;
            parameters[1].Value = intOperatorID;
            return this.RunProcedure("sp_Report_CSRCategory", parameters, "CSRCategoryReport");
        }

        public DataSet GetTeamCategoryReport(string strStartDate, string strEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            return this.RunProcedure("sp_Report_TeamCategory", parameters, "TeamCategoryReport");
        }

        public DataSet GetCSRProductivityReport(string strStartDate, string strEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            return this.RunProcedure("sp_Report_CSRProductivity", parameters, "CSRProductivityReport");
        }

        public DataSet GetTeamProductivityReport(string strStartDate, string strEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartECCDate",SqlDbType.VarChar,20),
                new SqlParameter("@EndECCDate",SqlDbType.VarChar,20)
            };
            parameters[0].Value = strStartDate;
            parameters[1].Value = strEndDate;
            return this.RunProcedure("sp_Report_TeamProductivity", parameters, "TeamProductivityReport");
        }

        public DataSet GetSaleCommodityReport(string strDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartDate",SqlDbType.VarChar,20)};
            parameters[0].Value = strDate;
            return this.RunProcedure("sp_Report_SaleCommodity", parameters, "SaleCommodityReport");
		}
		#endregion

        public DataSet GetSettingOFFCategory()
        {
            return this.RunProcedure("sp_EXT_Setting_OFFCategory", "Setting_OFFCategory");
        }

        public DataSet GetSettingCategory()
        {
            return this.RunProcedure("sp_EXT_Setting_Category", "Setting_Category");
        }

        

        public DataSet GetMaiReceivedReport(DateTime dtStartDate, DateTime dtEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
            parameters[0].Value = dtStartDate;
            parameters[1].Value = dtEndDate;
            return this.RunProcedure("sp_EXT_MailReceived_Report", parameters, "MailReceivedReport");
        }

        public DataSet GetOFFAnnotationReport(DateTime dtStartDate, DateTime dtEndDate)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
            parameters[0].Value = dtStartDate;
            parameters[1].Value = dtEndDate;
            return this.RunProcedure("sp_EXT_OFFAnnotatin_Report", parameters, "OFFAnnotatinReport");
        }

		public DataSet GetPersonalMailReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_PersonalMailReport_GetList", parameters, "PersonalMailReport");
		}

		public DataSet GetMailCheckReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_MailCheckReport_GetList", parameters, "MailCheckReport");
		}

		public DataSet GetEfficiencyReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_EfficiencyReport_GetList", parameters, "EfficiencyReport");
		}

		public DataSet GetDetailMemberReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_DetailMemberReport_GetList", parameters, "DetailMemberReport");
		}

		public DataSet DetailManagementReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_DetailManagementReport_GetList", parameters, "DetailManagementReport");
		}

		public DataSet CategoryReportReport(DateTime dtStartDate, DateTime dtEndDate, string strKeyID)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime),
				new SqlParameter("@CategoryScore_KeyID",SqlDbType.UniqueIdentifier)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			Guid guid = new Guid(strKeyID);
			parameters[2].Value = guid;
			return this.RunProcedure("sp_CategoryReport_GetList", parameters, "CategoryReport");
		}

		public DataSet GetEfficiencyOverTimeReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_EfficiencyOverTimeReport_GetList", parameters, "EfficiencyOverTimeReport");
		}

		public DataSet GetPersonalAppointMailReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_PersonalAppointMailReport_GetList", parameters, "PersonalAppointMailReport");
		}

		public DataSet GetAppointEfficiencyReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;
			return this.RunProcedure("sp_AppointEfficiencyReport_GetList", parameters, "AppointEfficiencyReport");
		}

		public DataSet GetWorkModeReport()
		{
			return this.RunProcedure("sp_WorkModeReport_GetList", new IDataParameter[] { }, "AppointEfficiencyReport");
		}

		public DataSet GetCSRProductivityReportNew(DateTime dtStartDate, DateTime dtEndDate)
        {
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;

			return this.RunProcedure("sp_Report_CSRProductivityNew", parameters, "CSRProductivityReport");
        }

		public DataSet GetTeamProductivityNew(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;

			return this.RunProcedure("sp_Report_TeamProductivityNew", parameters, "TeamProductivityNew");
		}
		public DataSet GetTeamCategoryNew(DateTime dtStartDate, DateTime dtEndDate)
		{
			SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@StartTime",SqlDbType.DateTime),
                new SqlParameter("@EndTime",SqlDbType.DateTime)
            };
			parameters[0].Value = dtStartDate;
			parameters[1].Value = dtEndDate;

			return this.RunProcedure("sp_Report_TeamCategoryNew", parameters, "TeamCategoryNew");
		}
		
	}
}
